package com.ujiuye.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/loginServlet")
public class loginServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     String username=request.getParameter("username");
     String password=request.getParameter("password");
     boolean res=true;
     if (res){
         HttpSession session=request.getSession();
         session.setAttribute("username",username);
         response.sendRedirect("result.jsp");
     }else {
         response.sendRedirect("login.jsp");
     }
    }
}
